package com.android.task6;

import java.io.Serializable;

public class Contact implements Serializable{
	
	String firstName;
	String lastName;
	String phoneNumber;
	String emailAddress;
	String imContact;
	String street;
	String plz;
	String ort;
	
	
	public Contact(){
		
	}
	
	public Contact(String firstName, String lastName, String phoneNumber,String emailAddress){
		this.firstName = firstName;
		this.lastName = lastName;
		this.phoneNumber = phoneNumber;
		this.emailAddress = emailAddress;
	}
	
	public String getStreet() {
		return street;
	}

	public void setStreet(String street) {
		this.street = street;
	}

	public String getPlz() {
		return plz;
	}

	public void setPlz(String plz) {
		this.plz = plz;
	}

	public String getOrt() {
		return ort;
	}

	public void setOrt(String ort) {
		this.ort = ort;
	}

	public String getFullName(){
		return getFirstName().trim() +" "+getLastName().trim();
	}
	
	public String getFirstName() {
		return this.firstName;
	}

	public String getLastName() {
		return this.lastName;
	}

	public String getPhoneNumber() {
		return this.phoneNumber;
	}

	public String getEmailAddress() {
		return this.emailAddress;
	}

	public String getImContact() {
		return this.imContact;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public void setPhoneNumber(String phoneNumber) {
		if(this.phoneNumber.length() > 0){
			this.phoneNumber += ", "+phoneNumber;
		}
		else{
			this.phoneNumber = phoneNumber;
		}
	}

	public void setEmailAddress(String emailAddress) {
		if(this.emailAddress.length() >0){
			this.emailAddress+= ","+emailAddress;
		}
		else{
			this.emailAddress = emailAddress;
		}
	}

	public void setImContact(String imContact) {
		if(this.imContact.length() > 0){
			this.imContact += ", "+imContact;
		}
		else{
		this.imContact = imContact;
		}
	}
	
	public String getAddress(){
		
		return getStreet().trim() +" "+getPlz().trim()+" "+getOrt().trim();
	}
	

}
